<template>
	<view class="">
		<mumu-get-qrcode @success='qrcodeSucess' @error="qrcodeError"></mumu-get-qrcode>
	</view>
</template>

<script>
	import mumuGetQrcode from '@/uni_modules/mumu-getQrcode/components/mumu-getQrcode/mumu-getQrcode.vue'

	export default {
		components: {
			mumuGetQrcode
		},
		methods: {
			qrcodeSucess(data) {
				console.log('扫码')
				console.log(data, 'data');
				uni.$emit('isRefresh', data)
				uni.navigateBack({
					delta: 1
				})
				// uni.showModal({
				// 	title: '成功',
				// 	content: data,
				// 	success: () => {
				// 		uni.$emit('isRefresh', data)
				// 		uni.navigateBack({
				// 			delta: 1
				// 		})
				// 	}
				// })
			},
			qrcodeError(err) {
				console.log(err, 'err');
				uni.showModal({
					title: 'Camera authorization failure',
					content: 'The camera authorization fails. Check whether the current browser has the camera permission.',
					cancelText: "cancel",
					confirmText: "confirm",
					success: () => {
						uni.$emit('isRefresh', err)
						uni.navigateBack({
							delta: 1
						})
					}
				})
			}
		}
	}
</script>

<style>
</style>